<% 
	var headContent = {
	include("/pages/template/head.bee"){}
%>

<script type="text/javascript">
var oper ;
jQuery(function($) {
	oper = new flyfox("money", "金钱");
	oper.height = 6 * 60 + 90; // 重设高度
	if(oper.height < 300) oper.height = 300;
	if(oper.height > 500) oper.height = 500;
	paginator = function(page) {
		oper.list();
	};

	//显示Menu索引
	showMenu('page_money');
});
</script>

<%
};

var bodyContent = {
%>
	<form name="form1" action="" method="post"  class="form-inline" role="form">
		<!-- 菜单 -->
		<% include("/static/component/include/menu.bee"){} %>

		<div class="tableSearch">
			<div class="form-group">
			   <label  class="control-label">项目名称</label>
			   <select name="attr.project_id" class="form-control" style="width: 100px;">
						<option value="">请选择</option> ${optionList }
				</select> 
			</div>
			<div class="form-group">
				<label class="sr-only">类型</label>
				<select name="attr.type" class="form-control" >
					<option value="">请选择</option> ${flyfox.dictSelect("moneyType",1)}
				</select>
			</div>
			<div class="form-group">
				<label class="sr-only">区间</label>
				<input type="date" name="pay_time_start" class="form-control"
					value="${attr.pay_time_start}" placeholder="开始时间"  />
				-<input type="date" name="pay_time_end" class="form-control" 
					value="${attr.pay_time_end}"  placeholder="结束时间"  />
			</div>
			<div class="form-group">
			  <label class="sr-only">费用概要</label>
			  <input type="text" class="form-control"  name="attr.name" value="${attr.name }" placeholder="请输入费用概要">
			</div>
			<button type="button" class="btn btn-default" onclick="oper.list();" name="search">
			 		<span class="glyphicon glyphicon-search"></span> 查 询
			</button>
			<button type="button" class="btn btn-default" onclick="resetForm();">
			 		<span class="glyphicon glyphicon-refresh"></span> 重 置
			</button>
			<button type="button" class="btn btn-default" onclick="oper.add();">
			 		<span class="glyphicon glyphicon-plus"></span> 新 增
			</button>
		</div>
		
		<!-- 数据列表 -->
		<table class="table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th>序号</th>
					<th>项目名称</th> 
					<th>描述</th> 
					<th>金额(RMB)</th> 
					<th>类型</th> 
					<th>时间</th> 
					<th>备注</th> 
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
			<% for(item in page.list){ %>
				<tr>
					<td>${itemLP.index }</td>
					<%  // 列表内容 %>
					<td>${flyfox.selValue(project_name,item.project_id!'')  }</td>
					<td>${item.name}</td> 
					<td>${item.amount}</td> 
					<td>${flyfox.dictValue(item.type!'' )  }</td>
					<td>${item.pay_time}</td>
					<td title="${item.remark}">
					<% if (strutil.length(item.remark) > 6) { %>
						${strutil.subStringTo(item.remark, 0, 6)}...
					<% 	} else { %>
						${item.remark}
					<%  } %>
					</td> 
	 
					<td>
					<a href="javascript:void(0);" class="btn btn-sm btn-success" onclick="oper.view(${item.id});">查看</a> 
					<a href="javascript:void(0);" class="btn btn-sm btn-primary" onclick="oper.edit(${item.id});">修改</a> 
					<a href="javascript:void(0);" class="btn btn-sm btn-danger" onclick="oper.del(${item.id});">删除</a>
					</td>
				</tr>
			<% } %>
			</tbody>
		</table>
		<%include("/static/component/include/paginator.bee"){} %>
	</form>
<%}; %>


<% layout("/pages/template/_layout.bee",{head:headContent,body:bodyContent}){ %>
<%} %>